const koa = require('koa')

const app= new koa()

const main = ctx => {
    ctx.response.body = 'Hello world'  // HTTP reponse
}

app.use(main)  // 加载main这个函数
app.listen(3000)